//
//  OIAddressFormatter.m
//  OrchIDE
//
//  Created by local22 on 8/14/07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import "OIAddressFormatter.h"
#import "emulator.h"

@implementation OIAddressFormatter
- (NSString *)hexFormat
{
	return @"%05x";
}

- (BOOL)getObjectValue:(id *)obj forString:(NSString *)string errorDescription:(NSString **)errorDescription
{
	BOOL retVal = [super getObjectValue:obj forString:string errorDescription:errorDescription];
	if(retVal && obj) {
		if([*obj intValue] > MEMORY_SIZE) {
			if(errorDescription) {
				*errorDescription = @"Address too large";
			}
			*obj = nil;
			retVal = NO;
		}
	}
	
	return retVal;
}
@end
